<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title>管理员登录</title>
    <meta name="description" content=""/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <!-- Basic Styles -->
    <link rel="stylesheet" type="text/css" media="screen" href="<%- Virtual_Path.Static %>common/css/common.css">
    <link rel="stylesheet" type="text/css" media="screen" href="<%- Virtual_Path.Static %>common/css/animate.min.css">
    <!-- bootstrap -->
    <link rel="stylesheet" href="<%- Virtual_Path.Static %>aceadmin/css/bootstrap.min.css"/>
    <!-- font -->
    <link rel="stylesheet" href="<%- Virtual_Path.Static %>common/font/google_opensans_v10/font.css">
    <link rel="stylesheet" href="<%- Virtual_Path.Static %>common/font/font-awesome-4.7.0/css/font-awesome.min.css">
    <!-- ace settings handler -->
    <script src="<%- Virtual_Path.Static %>aceadmin/js/ace-extra.min.js"></script>
    <!-- basic scripts -->
    <script type="text/javascript">
        window.jQuery || document.write("<script src='<%- Virtual_Path.Static %>jquery/jquery-2.1.4.min.js'>" + "<" + "/script>");
    </script>
    <script type="text/javascript">
        if ('ontouchstart' in document.documentElement) document.write("<script src='<%- Virtual_Path.Static %>aceadmin/js/jquery.mobile.custom.js'>" + "<" + "/script>");
    </script>
    <!-- JQuery.Form -->
    <script src="<%- Virtual_Path.Static %>jquery.plugin/form/jquery.form.min.js"></script>
    <!-- JQuery.Validate -->
    <script src="<%- Virtual_Path.Static %>jquery.plugin/validate/jquery.validate.min.js"></script>
    <script src="<%- Virtual_Path.Static %>jquery.plugin/validate/jquery.validate.extend.min.js"></script>
    <script src="<%- Virtual_Path.Static %>jquery.plugin/validate/additional-methods.min.js"></script>
    <!-- koc -->
    <script src="<%- Virtual_Path.Static %>jquery.plugin/koc/koc.min.js"></script>
    <link rel="stylesheet" href="<%- Virtual_Path.Static %>jquery.plugin/koc/koc.css"/>
    <!-- bootstrap -->
    <script src="<%- Virtual_Path.Static %>aceadmin/js/bootstrap.min.js"></script>
    <!-- ace styles class="ace-main-stylesheet id="main-ace-style" -->
    <link rel="stylesheet" href="<%- Virtual_Path.Static %>aceadmin/css/ace.min.css"/>
    <!-- Admin Basic Styles -->
    <link rel="stylesheet" type="text/css" media="screen" href="<%- Virtual_Path.Static %>admin/css/common.css">
    <!-- PageScript -->
    <script><%- PageScript %></script>
</head>

<body class="login-layout light-login">
<div class="main-container">
    <div class="main-content">
        <div class="row">
            <div class="col-sm-10 col-sm-offset-1">
                <div class="login-container">
                    <div class="center">
                        <h1>
                            <i class="ace-icon fa fa-wrench red"></i>
                            <span class="red"></span>
                            <span class="id-text2">全民秀后台管理系统</span>
                        </h1>
                        <!--<h4 class="blue">&copy; 北京胜联信息技术有限公司</h4>-->
                    </div>
                    <div class="space-6"></div>
                    <div class="position-relative">
                        <div id="login-box" class="login-box visible widget-box no-border">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <h4 class="header blue lighter bigger">
                                        <i class="ace-icon fa fa-coffee green"></i>
                                        请输入管理员信息登录
                                    </h4>

                                    <div class="space-6"></div>
                                    <form id="formLogin">
                                        <fieldset>
                                            <label class="block clearfix">
                                                <span class="block input-icon input-icon-left">
                                                    <input name="LoginName" type="text"  class="form-control" placeholder="账号"/>
                                                    <i class="ace-icon fa fa-phone"></i>
                                                </span>
                                            </label>

                                            <label class="block clearfix">
                                                <span class="block input-icon input-icon-left">
                                                    <input name="Password" type="password" maxlength="20" class="form-control" placeholder="密码"/>
                                                    <i class="ace-icon fa fa-lock"></i>
                                                </span>
                                            </label>
                                            <div class="space"></div>

                                            <div class="clearfix">
                                                <button type="submit"
                                                        class="width-45 pull-right btn btn-sm btn-primary">
                                                    <i class="ace-icon fa fa-key"></i>
                                                    <span class="bigger-110">管理员登录</span>
                                                </button>
                                            </div>

                                            <div class="space-4"></div>
                                        </fieldset>
                                    </form>

                                    <div class="social-or-login center">
                                        <span class="bigger-110">本站不支持IE浏览器，推荐使用以下浏览器</span>
                                    </div>

                                    <div class="space-6"></div>

                                    <div class="social-login center">
                                        <a href="http://www.google.cn/intl/zh-CN/chrome/" target="_blank">
                                            <img src="<%- Virtual_Path.Static %>common/image/icon_e_chrome.png"
                                                 width="42" height="42"></a>
                                        <a href="http://browser.qq.com/" target="_blank">
                                            <img src="<%- Virtual_Path.Static %>common/image/icon_e_qq.png" width="42"
                                                 height="42"></a>
                                        <a href="http://ie.sogou.com/" target="_blank">
                                            <img src="<%- Virtual_Path.Static %>common/image/icon_e_sogou.png"
                                                 width="42" height="42"></a>
                                        <a href="http://se.360.cn/" target="_blank">
                                            <img src="<%- Virtual_Path.Static %>common/image/icon_e_360.png" width="42"
                                                 height="42"></a>
                                        <a href="http://chrome.360.cn/" target="_blank">
                                            <img src="<%- Virtual_Path.Static %>common/image/icon_e_360chrome.png"
                                                 width="42" height="42"></a>
                                    </div>

                                    <div class="space-6"></div>

                                    <div class="center">
                                        <span>使用以上浏览器极速模式以得到最好的浏览体验</span>
                                    </div>
                                </div>

                                <div class="toolbar clearfix">
                                    <div>
                                        <a href="http://www.google.cn/intl/zh-CN/chrome/" class="forgot-password-link"
                                           target="_blank">
                                            下载谷歌浏览器
                                        </a>
                                    </div>

                                    <div>
                                        <a href="http://www.google.cn/intl/zh-CN/chrome/" data-target="#signup-box"
                                           class="user-signup-link" target="_blank">
                                            下载360极速浏览器
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- MD5 -->
<script src="<%- Virtual_Path.Static %>jquery.plugin/md5/md5.min.js"></script>
<!--<script src="<%- Virtual_Path.Static %>jquery.plugin/koc/jquery.koc.md5.min.js"></script>-->

<script>
    $(function () {
        //////////////////////////////////////////////
        //重新获取验证码
        //////////////////////////////////////////////
        $("#formLogin").validate({
            rules: {
                LoginName: {
                    required: true,
//                    digits: true,
                    rangelength: [1, 35]
                },
                Password: {
                    required: true,
                    rangelength: [3, 20]
                },
//                VerifyCode: {
//                    required: true,
//                    rangelength: [4, 4]
//                }

            },
            messages: {
                LoginName: {
                    required: '请输入账号'
                },
                Password: {
                    required: '请输入登录密码'
                },
//                VerifyCode: {
//                    required: '请输入验证码'
//                }
            },
            submitHandler: function (form) {
//                $("#formLogin [name='Password']").val(___md5(___md5($("#formLogin [name='Password']").val())));
                $("#formLogin [name='Password']").val(md5($("#formLogin [name='Password']").val()));
                $(form).ajaxSubmit({
                    type: "post",
                    dataType: "json",
                    url: "/ajax/base.user-signin",
                    beforeSubmit: function () {
                        $.KOC.Loading.Open();
                    },
                    success: function (data) {
                        $.KOC.Loading.Close();
                        if (data.flag !== 0) {
                            $("#formLogin [name='LoginName']").select();
                            $("#formLogin [name='Password']").val("");
//                            $("#formLogin [name='VerifyCode']").val('');
                            $.KOC.Tips.Open("Error", data.msg + "(" + data.flag + ")", {Timeout: 1000});
                            $('#imgMainUserSign_AuthCode').click();
                            return;
                        }
                        if(data._State.IsAdmin !==1){
                            $.KOC.Tips.Open("Error", "登录完成，本页将在1秒后自动跳转", {
                            Timeout: 50,
                            onClose: function () {
                                window.location.href =data.Address;
                            }
                        });
                        }else{
                            $.KOC.Tips.Open("Success", "登录完成，本页将在1秒后自动跳转", {
                                Timeout: 1000,
                                onClose: function () {
                                    window.location.href = "/main";
                                }
                            });
                        }

                    }
                });
            }
        });
    });

</script>

</body>

</html>
